package com.symbio.ishenapi.background.oss;

import org.springframework.web.multipart.MultipartFile;

public class UpImgServiceImpl implements UpImgService {


    @Override
    public String updateHead(MultipartFile file){
        if (file == null || file.getSize() <= 0) {
            //throw new ImgException("file不能为空");
        }
        OSSClientUtil ossClient=new OSSClientUtil();
        String name = ossClient.uploadImg2Oss(file,1L);
        String imgUrl = ossClient.getImgUrl(name);
        String[] split = imgUrl.split("\\?");
        return split[0];
    }
}
